package domain.entities;

import javax.persistence.*;
import java.util.Collections;
import java.util.Date;
import java.util.LinkedHashMap;

import static javax.persistence.GenerationType.IDENTITY;

/**
 * Secdiscrepancyreport entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "secdiscrepancyreport", catalog = "bms")
public class Secdiscrepancyreport implements java.io.Serializable {

	// Fields
	private Integer id;
	private ProtocoloCentro protocoloCentro;
	private Date receivedBms;
	private Date receivedFromSite;
	private String report;
	private Date sentToSite;
    private Integer scope;

    public static final String CLASSTITLE = "SEC/Discrepancy report";
    public static final LinkedHashMap<String, String> TITULOS = new LinkedHashMap<String, String>(
            Collections.unmodifiableMap(
                    new LinkedHashMap<String, String>() {
                        {
                            put("report", "Report");
                            put("receivedBms", "Received at BMS");
                            put("sentToSite", "Sent to Site");
                            put("receivedFromSite", "Received From Site");
                        }
                    }
            )
    );

	// Constructors

	/** default constructor */
	public Secdiscrepancyreport() {
	}

	/** minimal constructor */
	public Secdiscrepancyreport(ProtocoloCentro protocoloCentro) {
		this.protocoloCentro = protocoloCentro;
	}

	/** full constructor */
	public Secdiscrepancyreport(ProtocoloCentro protocoloCentro,
			Date receivedBms, Date receivedFromSite, String report,
			Date sentToSite) {
		this.protocoloCentro = protocoloCentro;
		this.receivedBms = receivedBms;
		this.receivedFromSite = receivedFromSite;
		this.report = report;
		this.sentToSite = sentToSite;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumns( {
			@JoinColumn(name = "PROTOCOLO_CENTROCENTROid", referencedColumnName = "CENTROid", nullable = false),
			@JoinColumn(name = "protocolo_centroprotocolo_compromisopaisprotocoloid", referencedColumnName = "protocolo_compromisopaisprotocoloid", nullable = false),
			@JoinColumn(name = "protocolo_centroprotocolo_compromisopaiscompromisopaisid", referencedColumnName = "protocolo_compromisopaiscompromisopaisid", nullable = false) })
	public ProtocoloCentro getProtocoloCentro() {
		return this.protocoloCentro;
	}

	public void setProtocoloCentro(ProtocoloCentro protocoloCentro) {
		this.protocoloCentro = protocoloCentro;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "receivedBMS", length = 10)
	public Date getReceivedBms() {
		return this.receivedBms;
	}

	public void setReceivedBms(Date receivedBms) {
		this.receivedBms = receivedBms;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "receivedFromSite", length = 10)
	public Date getReceivedFromSite() {
		return this.receivedFromSite;
	}

	public void setReceivedFromSite(Date receivedFromSite) {
		this.receivedFromSite = receivedFromSite;
	}

	@Column(name = "report")
	public String getReport() {
		return this.report;
	}

	public void setReport(String report) {
		this.report = report;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "sentToSite", length = 10)
	public Date getSentToSite() {
		return this.sentToSite;
	}

	public void setSentToSite(Date sentToSite) {
		this.sentToSite = sentToSite;
	}

    @Column(name = "scope")
    public Integer getScope() {
        return scope;
    }

    public void setScope(Integer scope) {
        this.scope = scope;
    }
}